/*--------------------------------------------------------------------------
  Project::HEXAGON FLIGHT SIMULATOR
  Package::SkyObjects
  Class::SkyDome
  File SkyDome.h
  --------------------------------------------------------------------------
  * METHODS AND CLASS PARAMETERS


  --------------------------------------------------------------------------
  * FUNCTIONS DESCRIPTION
  
  --------------------------------------------------------------------------
  * COPYRIGHT

  --------------------------------------------------------------------------
  * INFO ABOUT AUTHOR AND VERSIONS
  Author:	Tino Giorgio	Data: 
  Rev1:			Data:

  --------------------------------------------------------------------------
  * E-MAIL & CONTACTS

  GIORGIO TINO:	tinoshi@libero.it
	           	shapeofangels@hotmail.com
	            giorgio.tino@studenti.polito.it

  --------------------------------------------------------------------------*/

#if !defined(SKYDOME_H)
#define SKYDOME_H

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

/* PLIB includes */
#include <plib/ssg.h>
#include <plib/ssgAux.h>
#include <plib/ssgaSky.h>

/* Project classes includes*/
#include "Defines.h"
#include "Sky.h"

class SkyDome  
{
public:
	SkyDome(int nstars, sgdVec3* star_data);
	virtual ~SkyDome();
	
	ssgaSky *getSky(void);
	void setBrightness(double sol_angle);
	void setCampos(sgCoord* newCampos);
	void update(float dt);
	void setCloudColor(sgVec4 cc);
	void setFogColor(sgVec4 fc);
	void preDraw();
	void postDraw();
	float getSkyBrightness();

private:
	ssgaSky *sky;

	double m_log01;
	double sqrt_m_log01;
	
	double sol_angle;

	int nstars;
	sgdVec3 star_data;
	
	float  sky_brightness;
	double scene_brightness;
	
	sgCoord campos;

	sgVec4 sky_color;
	sgVec4 cloud_color;
	sgVec4 fog_color;


	sgVec4 scene_ambient;
	sgVec4 scene_diffuse;
	sgVec4 scene_specular;
};

#endif // !defined(SKYDOME_H)
